package in.muton.edushare.schedules.widgets;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.model.IModel;

public class DateLabel extends Label {

	private static final long serialVersionUID = 1742058882789563950L;

	public DateLabel(String id, Date date, int type) {
		super(id);
		this.date = date;
		switch (type) {
		case 0:
			setDefaultModel(new DateModel());
		}
	}

	private Date date = null;

	private class DateModel implements IModel<String> {

		private static final long serialVersionUID = -3174836475681103771L;

		public String getObject() {
			return new SimpleDateFormat("MMM d, yyyy hh:mm a").format(date);
		}

		public void setObject(String arg0) {
		}

		public void detach() {
		}

	}
}
